<!DOCTYPE html>
<html>
<head>
	<title>用户中心 -- 快件e栈服务平台</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<link href="../css/normalize.css" type="text/css" rel="stylesheet" />
	<link href="../css/common.css" type="text/css" rel="stylesheet" />
	<script src="js/jquery.min.js" type="text/javascript"></script>
	<script src="js/notice.js" type="text/javascript"></script>
	<script src="js/common.js" type="text/javascript"></script>
	<script src="/layer/layer.js"></script>
	<style type="text/css">
		body{
			background: #f4f4f4;
		}
		
		.userInfoCont{
			
		}
		.userHeaderDiv{
			background: #fff;
		}
		.userHeaderDiv .userHeader{
			width: 90%;
			margin: 0 auto;
			overflow: hidden;
			padding: 20px 0px 10px;
			border-bottom: 1px solid #f1f1f1;
		}
		.userHeader .headerImg{
			width: 20%;
			float: left;
			border-radius: 50%;
			overflow: hidden;
		}
		.userHeader .headerImg img{
			display: block;
		}
		.userHeader p{
			margin: 0;
			margin-left: 15px;
			padding-left: 35px;
			font-weight: bold;
			float: left;
			background: url(../images/student.png) no-repeat center left;
			background-size: 30px;
			overflow: hidden;
			white-space: nowrap; 
			text-overflow: ellipsis;
		}

		.userHeaderDiv .headerProm{
			width: 90%;
			margin: 0 auto;
			font-size: 12px;
			color:#888888;
		}
		.headerProm .editUserInfo{
			line-height: 60px;
			font-size: 14px;
			color:#333333;
			background: url(../images/rightArrow.png) no-repeat center right;
			background-size: 20px;
			border-bottom: 1px solid #f4f4f4;
		}
		.headerProm .userInfo{
			line-height: 60px;
			font-size: 14px;
			color:#333333;
			background-size: 20px;
			border-bottom: 1px solid #f4f4f4;
		}
		.headerProm .expUserInfo{
			line-height: 60px;
			font-size: 14px;
			color:#333333;
			background: url(../images/rightArrow.png) no-repeat center right;
			background-size: 20px;
		}

		.headerProm .userQRcode{
			line-height: 60px;
			font-size: 14px;
			color:#333333;
			background: url(../images/rightArrow.png) no-repeat center right;
			background-size: 20px;
		}

		.userNewsCont{
			width: 90%;
			padding: 0px 5%;
			margin: 30px auto 10px;
			background: #fff;
		}
		.userNewsCont .userNews{
			width: 100%;
			border-bottom: 1px solid #f4f4f4;
			background: url(../images/rightArrow.png) no-repeat center right;
			background-size: 20px;
		}
		.userNewsCont .userNews p{
			width: 80%;
			margin:0px;
			padding-left: 30px;
			line-height: 60px;
			font-size: 12px;
			background: url(../images/usernotice.png) no-repeat center left;
			background-size: 20px;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.userNewsCont .userNewsLast{
			border:none;
		}
	</style>
</head>
<body>
	<div class="content">
	<div class="headerNav">
		<div class="headerNavTop"><div class="headerNavIcon headerNavIconOut"><span></span><span></span></div></div>
		<div class="headerNavCont">
			<a href="index.html">快递首页</a>
			<a href="./userhome.html">个人中心</a>
			<a href="./delivery.html">送货上门</a>
		<!-- 	<a href="./sendexpress.html">我要寄件</a> -->
			<a href="lazyboard.html">懒人排行</a>
			<a href="./expassistant.html">快递助手</a>
		</div>
	</div>

	<div class="userInfoCont">
		<div class="userHeaderDiv">
			<a href="#" id="update"><div class="userHeader">
				<div class="headerImg">
					<img src="../images/userHeadImg.jpg" alt="正在加载中..." width="100%">
				</div>
				<p id="username"></p>
			</div></a>
			<div class="headerProm">
				<p class="certification">请及时完善个人信息，方便快递员配送</p>
				<input id="PageContext" type="hidden" value="${pageContext.request.contextPath}" />
				<div class="editUserInfo certification" id="notVerified">
					完善个人信息
				</div>
				<div class="userQRcode">
					我的取货二维码
				</div>
			</div>
		</div>

		<div class="userNewsCont certification">
			<div class="userNews  userNewsRead">
				<p>[通知]请尽快完善个人信息，以便领取快递</p>
			</div>
		</div>
	</div>

	<div class="footer">
		<p class="copyInfotxt">&copy;新职课版权所有</p>
	</div>
</div>
<script type="text/javascript">
	$(function() {
		$.getJSON("/wx/userInfo.do", null, function (data) {
			var userPhone = data.data.userPhone;
			if (data.status === 0) {
				$(".certification").hide();
				$("#update").prop("href", "wxIdCardUserInfoModify.html");
				$("#username").text(data.data.username);
				$.getJSON("/wx/getUserInfo.do", {type:0,userPhone:userPhone}, function (data) {
					var	courier = data.data;
					$(".headerProm").append("<div class=\"userInfo\">身份证号:"+courier.idCard+"</div>\n" +
							"\t\t\t\t<div class=\"userInfo\">手机号码:"+courier.phone+"</div>\n" +
							"\t\t\t\t<div class=\"userInfo\">派单数:"+courier.numberDispatch+"</div>\n" +
							"\t\t\t\t<div class=\"userInfo\">注册时间:"+courier.signUpTime+"</div>\n" +
							"\t\t\t\t<div class=\"userInfo\">上次登录时间:"+courier.loginTime+"</div>");
				});
			}else {
				$.getJSON("/wx/userStatus.do", {userPhone:userPhone}, function (data) {
					if (data.status !== 0) {
						$(".certification").hide();
						$("#update").prop("href", "wxIdCardUserInfoModify.html");
						$.getJSON("/wx/getUserInfo.do", {type:1,userPhone:userPhone}, function (data) {
							var	user = data.data;
							$("#username").text(user.nickName);
							$(".headerProm").append("<div class=\"userInfo\">身份证号:"+user.idCard+"</div>\n" +
									"\t\t\t\t<div class=\"userInfo\">手机号码:"+user.phone+"</div>\n" +
									"\t\t\t\t<div class=\"userInfo\">注册时间:"+user.signUpTime+"</div>\n" +
									"\t\t\t\t<div class=\"userInfo\">上次登录时间:"+user.loginTime+"</div>");
						});
					}else {
						$("#username").text(userPhone);
					}
				})
			}
		})
		var pageContextVal = $("#PageContext").val();
		var initFun = function(){
			var windowH = $(window).height();
			var contentH = $(".userInfoCont").height();
			if ((windowH - 30 - 50)>contentH) {
				$(".userInfoCont").css({"height":(windowH -30 - 50)+"px"}); //nav footer
			}

			var headerW = $(".userHeader").width();
			var headImgH = headerW*0.2;
			var headPW = headerW*0.8 - 60; // 15+35
			$(".userHeader p").css({"line-height":headImgH+"px","width":headPW+"px"});
		};

		initFun();

		$(window).resize(function(){
			initFun();
		});

		// user Info Edit
		$("#notVerified").click(function(){
			window.location.href="userCheckStart.html"; 
		});

		$(".expUserInfo").click(function(){
			window.location.href="userLazyboard.html"; 
		});

		$(".userQRcode").click(function(){
			window.location.href = "/wx/createQRCode.do?type=user";
		});
	});
</script>
</body>
</html>